<div class="content-section implementation GridDemo clearfixes storageOverview">
  <div class="mysearch">
    <form>
    <div class="ui-g">
      <div class="ui-g-4 ui-sm-12">
        <label class="ui-g-2 ui-sm-5 text-right">入库单号:</label>
        <div class="ui-g-4  ui-sm-7 ui-fluid">
          <input pInputText type="text" name="sid" placeholder="入库单号" [(ngModel)]="queryModel.condition.sid" />
        </div>
        <label class="ui-g-2 ui-sm-5 ui-no-padding-left-15px text-right">经手人:</label>
        <div class="ui-g-4 ui-sm-7 ui-fluid  ui-no-padding-right-15px ">
          <input  pInputText type="text" name="status" placeholder="经手人"  [(ngModel)]="queryModel.condition.creator" />
        </div>
      </div>
      <div class="ui-g-4 ui-sm-12">
        <label class="ui-g-3 ui-sm-5 text-right">入库时间:</label>
        <div class="ui-g-4  ui-sm-7 ui-fluid">
          <p-calendar  [showIcon]="true" [locale]="zh" name="time_start"
                       [styleClass]="'schedule-add'" dateFormat="yy-mm-dd"  dataType="string"
                       [minDate]="minDate" [(ngModel)]="queryModel.condition.begin_time"  >
          </p-calendar>
        </div>
        <label class="ui-g-1 ui-sm-5" >至:</label>
        <div class="ui-g-4  ui-sm-7 ui-fluid ">
          <p-calendar  [showIcon]="true" [locale]="zh" name="end_time"
                       [styleClass]="'schedule-add'" dateFormat="yy-mm-dd" dataType="string"
                       [minDate]="minDate" [(ngModel)]="queryModel.condition.end_time" >
          </p-calendar>
        </div>
      </div>

      <div class="ui-g-4 ui-sm-12">
        <label  class="ui-g-3 ui-sm-5 text-right">状态:</label>
        <div class="ui-g-5  ui-sm-7 ui-fluid ">
          <p-dropdown [options]="MaterialStatusData" [(ngModel)]="queryModel.condition.status" [autoWidth]="false" name="cycle" (onChange)="suggestInsepectiones()" ></p-dropdown>
        </div>
        <div class="ui-g-4 ui-sm-12 option">
          <button pButton type="button" label="查询" ngClass="ui-sm-12" (click)="suggestInsepectiones()" ></button>
          <button pButton  label="清空" ngClass="ui-sm-12"  (click)="clearSearch()"></button>
        </div>

      </div>
    </div>
    </form>
  </div>
  <div class="ui-g">
  <div class="ui-g-12 ui-md-12 ui-lg-12">
    <p-dataTable [value]="MaterialData"
                 [totalRecords]="totalRecords"  [(selection)]="selectMaterial" >
      <!--<p-column [style]="{'width':'38px'}" selectionMode="multiple" ></p-column>-->
      <p-column  field="sid" header="入库单号" [sortable]="true" >
        <ng-template let-data="rowData" pTemplate="body" let-i="rowIndex">
          <span (click)="viewBorrowApproved(data)" class="curser">{{data.sid}}</span>
        </ng-template>
      </p-column>
      <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"  [sortable]="true"></p-column>
      <ng-template pTemplate="emptymessage">
        当前没有数据
      </ng-template>
      <p-column header="操作">
        <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
          <button pButton type="button"  label="编辑"  (click)="updateOption(MaterialData[i])" *ngIf="MaterialData[i]['status'] === '新建' || MaterialData[i]['status'] === '驳回'"  ></button>
          <button pButton type="button"  label="删除"  (click)="deleteMaterial(MaterialData[i])"  *ngIf="MaterialData[i]['status'] === '新建'"   ></button>
          <button pButton type="button"  label="审批" (click)="storageApproved(MaterialData[i])"  *ngIf="MaterialData[i]['status'] === '待审批'" ></button>
          <button pButton type="button"  label="入库"  (click)="sureApproved(MaterialData[i])"  *ngIf="MaterialData[i]['status'] === '待入库'"  ></button>
          <button pButton type="button"  label="查看" (click)="viewBorrowApproved(MaterialData[i])"     ></button>
        </ng-template>
      </p-column>
    </p-dataTable>
    <p-paginator rows="10" [totalRecords]="totalRecords" [rowsPerPageOptions]="[10,20,30]" (onPageChange)="paginate($event)"></p-paginator>
  </div>
  </div>
</div>



